package com.itheima.stock.controller.v1;

import com.itheima.stock.api.StockControllerAPI;
import com.itheima.stock.entity.StockBusiness;
import com.itheima.stock.response.ResponseResult;
import com.itheima.stock.service.StockService;
import com.itheima.stock.vo.InnerMarketVO;
import com.itheima.stock.vo.SectorAllVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
@RestController
public class StockController implements StockControllerAPI {
    @Autowired
    private StockService stockService;

    @Override
    public ResponseResult<List<SectorAllVO>> sectorAll() {
        return ResponseResult.ok(stockService.sectorAll());
    }

    @Override
    public ResponseResult<List<InnerMarketVO>> innerIndexAll() {
        return ResponseResult.ok(stockService.innerIndexAll());
    }

    @Override
    public ResponseResult<List<StockBusiness>> getStockBusiness() {
       return ResponseResult.ok(stockService.getStockBusiness());
    }
}
